<style>
	#add_Rule_form input , #modify_Rule_form input{
		width:200px;
	}
	#modify_Rule_form select,#add_Rule_form select {
		width:95px;
	}
	#add_Rule_form td ,#modify_Rule_form td{
		height: 30px;
	}
</style>
<!-- 工具栏 -->
<div id="tool-rule">    
<table>
    <tr>
        <td>
            <a href="#" id="aaa1" class="easyui-linkbutton" onclick='show_add_mRule()' data-options="iconCls:'icon-standard-folder-add',plain:true">新建主权限</a>
            <a href="#" id="aaa1" class="easyui-linkbutton" onclick='show_add_sRule()' data-options="iconCls:'icon-standard-folder-page',plain:true">新建子权限</a>
            <a href="#" id="aaa1" class="easyui-linkbutton" onclick='del_Rule()' data-options="iconCls:'icon-standard-page-white-delete',plain:true">删除</a>
            <a href="#" id="aaa1" class="easyui-linkbutton" onclick='show_modify_Rule()' data-options="iconCls:'icon-standard-application-edit',plain:true">修改</a>
        </td>
    </tr>
</table>
</div>
<!-- 工具栏end -->
<!-- 新建菜单对话框 -->
<div id="add_Rule_dialog" class="easyui-dialog" style="width:360px; height: 195px; padding: 10px 50px; overflow: hidden;" title="新建权限" data-options="iconCls:'icon-standard-folder-page',buttons:'#add_Rule_tool',closed:true,resizable:true,modal:true,closable:true">
	<form id="add_Rule_form" method="post">
	<input type="hidden" id="pid" name="pid"/>
	    	<table cellpadding="5">
	    		<tr>
	    			<td>标题:</td>
	    			<td><input class="easyui-textbox" type="text" id="text" name="text" data-options="required:true,prompt:'请输入权限名称'"  ></input></td>
	    		</tr>
	    		<tr>
	    			<td>URL:</td>
	    			<td><input class="easyui-textbox" type="text" id="name" name="name" data-options="required:true,prompt:'请输入URL:如Admin/Name/add'" ></input></td>
	    		</tr>
	    		<tr>
	    			<td>类型:</td>
	    			<td>
					<select id="leixing" class="easyui-combobox" name="leixing" data-options="editable:false,panelHeight:'auto'">   
					    <option  selected="selected" value="1">菜单</option>   
					    <option value="2">操作</option>   
					    <option value="3">数据列表</option>      
					</select>
					<span id="iconFj">

						<a id="btnNewAuthIcon" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-standard-exclamation'" onclick="showSetIcon('newAuthIcon','btnNewAuthIcon')"></a>
					<input type="hidden" id='newAuthIcon' name='icon'>
					序号:
					<input class="easyui-numberbox"  id="odernumber" name="odernumber" data-options="" style="width:40px;"></input>
					</span>

					
	    			</td>
	    		</tr>		    		
	    	</table>
	    </form>

</div>
<div id="add_Rule_tool">
	<div class="tool_tip">添加后会在列表中出现！！</div>
	<a href="#" id="addok" class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
		onclick="add_Rule()">确认</a>
	<a href="#" class="easyui-linkbutton"
		data-options="iconCls:'icon-cancel'"
		onclick="javascript:$('#add_Rule_dialog').dialog('close')">取消</a>
</div>
<!-- 新建菜单对话框 end-->

<!-- 修改菜单对话框 -->
<div id="modify_Rule_dialog" class="easyui-dialog" style="width:360px; height: 195px; padding: 10px 50px; overflow: hidden;" title="修改菜单" data-options="iconCls:'icon-standard-application-edit',buttons:'#modify_Rule_tool',closed:true,resizable:false,modal:true,closable:true">
	<form id="modify_Rule_form" method="post">
			<input type="hidden" id="id" name="id"/>
	    	<table cellpadding="5">
	    		<tr>
	    			<td>标题:</td>
	    			<td><input class="easyui-textbox" type="text" id="text" name="text" data-options="required:true,prompt:'请输入菜单名称'"  ></input></td>
	    		</tr>
	    		<tr>
	    			<td>URL:</td>
	    			<td><input class="easyui-textbox" type="text" id="name" name="name" data-options="required:true,prompt:'请输入URL:如Admin/Name/add'" ></input></td>
	    		</tr>
	    			<tr>
	    			<td>类型:</td>
	    			<td>
					<select id="leixingxg" class="easyui-combobox" name="leixing" data-options="editable:false,panelHeight:'auto'">   
					    <option  selected="selected" value="1">菜单</option>   
					    <option value="2">操作</option>   
					    <option value="3">数据列表</option>      
					</select>
					<span id="iconFjxg">

						<a id="btnNewAuthIconxg" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-standard-exclamation'" onclick="showSetIcon('newAuthIconxg','btnNewAuthIconxg')"></a>
					<input type="hidden" id='newAuthIconxg' name='icon'>
					序号:
					<input class="easyui-numberbox"  id="odernumberxg" name="odernumber" data-options="" style="width:40px;"></input>
					</span>
	    			</td>
	    		</tr>	
	    	</table>
	    </form>

</div>
<div id="modify_Rule_tool">
	<div class="tool_tip">添加后会在列表中出现！！</div>
	<a href="#" id="modifyok" class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
		onclick="modify_Rule()">确认</a>
	<a href="#" class="easyui-linkbutton"
		data-options="iconCls:'icon-cancel'"
		onclick="javascript:$('#modify_Rule_dialog').dialog('close')">取消</a>
</div>



<!-- 修改菜单对话框 end-->

<script>
	$('#leixing').combobox({
    onChange: function(newValue,oldValue){
        // console.log(record);
        if(newValue!=1){
        	$("#iconFj").hide();
        }else{
        	$("#iconFj").show();
        }
    }
});
	$('#leixingxg').combobox({
    onChange: function(newValue,oldValue){
        // console.log(record);
        if(newValue!=1){
        	$("#iconFjxg").hide();
        }else{

        	var row = $('#rulelist').treegrid("getSelected");

        	if(row.icon!='' && row.icon){
    $('#btnNewAuthIconxg').linkbutton({    
        iconCls:row.icon
    });  
}else{
 $('#btnNewAuthIconxg').linkbutton({    
        iconCls:'icon-standard-exclamation'
    });
    
}
        	$("#iconFjxg").show();
        }
    }
});	


	// function refresh(){
	// 	    $.ajax({  
 //            type : 'POST',  
 //            dataType : "json",  
 //            url : '__APP__/Admin/Public/menulist',  
 //            success : function(data) {  
 //                $.each(data, function(i, n) {
 //                	var is=$('#layout_west_accordion').accordion('select',n.text);
 //                	if(!is){
 //                		  if (i == 0) {
 //                        $('#layout_west_accordion').accordion('add', {  
 //                            title : n.text,  
 //                            iconCls : n.icon,  
 //                            selected : true,  
 //                            content : '<div style="padding:10px"><ul name="'+n.text+'"></ul></div>',  
 //                        });  
 //                    } else {  
 //                        $('#layout_west_accordion').accordion('add', {  
 //                            title : n.text,  
 //                            iconCls : n.icon,  
 //                            selected : false,  
 //                            content : '<div style="padding:10px"><ul name="'+n.text+'"></ul></div>',  
 //                        });  
 //                    }  
 //                	}
                  
  
 //                });  
 //            }  
 //        }); 

		


	// }
</script>
